import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from "@/views/Layout"
import Home from "@/views/Home"
import Play from "@/views/Play"
import Search from "@/views/Search"

Vue.use(VueRouter)
const routes = [
    {
        path: '/',
        redirect:'/Layout'
    },
    {
        path: '/Layout',
        component: Layout,
        redirect:'layout/home',
        children: [
            {
                path: 'home',
                component: Home,
                meta: { //meta是保存路由对象额外信息的
                    title:'首页'
                }
            },
            {
                path: 'search',
                component: Search,
                meta: {
                    title:'搜索'
                }
            }
        ]
    },
    {
        path: '/Play',
        component:Play
    }
] 
    
const router = new VueRouter({
    routes
})

export default router 